#ifndef _PLAYER
#define _PLAYER

#include "treasure.hpp"
#include <list>
#include <iostream>

using namespace std;

class Player
{
public:
    unsigned int unique_id;
    string name;
    unsigned int x;
    unsigned int y;
    unsigned int score;
    list<Treasure> list_treasure;

    Player(unsigned int id=0,unsigned int x=0,unsigned int y=0,unsigned int score=0,string name="");

    void add_tresure(const Treasure & t);
    bool is_in_list(const Treasure & t)const;

    friend ostream & operator << (ostream & ost,const Player & p)
    {
        ost << "Name : " << p.name << endl << "Position : (" << p.x << "," << p.y << ")" << endl << "Score : " << p.score << endl;

        for(auto & i:p.list_treasure)
        {
            ost << i << endl;
        }

        return ost;
    };
};

#endif
